#define functions that belong to api1 Navysri changed the code
from worklist import *

def createRole(name):
    x = name
    if addRole(x):
        print "Role has been added successfully"
    else:
        print "Already exists"
    
    pass
def createPerformer(name, , ,):
    new_user = user(rolelist,name,pwd,phone,email)
    if addUser(new_user):
        print "Performer has been added successfully"
    else:
        print "Already exists"    
    pass
def createWorkList(wl_name, , ):
       
    new_worklist = worklist(wl_name,workitems, roles)
    if addWorklist(new_worklist):
        print "Worklist has been created successfully"
    else:
        print "Already exists" 
    
    pass
def addWorkItem(workitem, worklist):

    new_workitem = workitem(duedate,status,priority,workitemId)
    if addWorkitem(new_workitem):
        worklist.enqueue(new_workitem)
        print "Workitem added successfully"
    else:
        print "Already exits"
    pass
#def createWorkitem():
#    pass

def getStatus(workitem):

    if exists(workitem):
        return workitem.status
    else:
        return -1
    
     pass
def pushBack():

    for x in workitems:
        if(getStatus(x) == 'done'):
            return x
        else:
            return -1
    
    pass
def pushWorkitem():
    pass

#mark as urgent
def setPriority(workitem):
    
    
    pass

def addRoleToPerformer(role):
    if user.addRole(role):
        print "Role added to performer"
    else:
        print "Already exists"
    
    pass

def addRoleToWorklist():

    if worklist.addRole(role):
        print "Role added to Worklist"
    else:
        print "Already exists"
    pass
